<?php

namespace Entity;

use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;

/**
 * @ORM\Entity
 * @ORM\Table(name="sim_owner")
 */
class SimOwner extends MappedSuperclassBase
{
    /**
     *
     * @var integer
     * @ORM\ManyToOne(targetEntity="User", inversedBy="sims")
     */
    protected $user;

    /**
     *
     * @var integer
     * @ORM\ManyToOne(targetEntity="Sim", inversedBy="users")
     */
    protected $sim;
    /**
     *
     * @ORM\Column(type="datetime", name="date")
     * @Gedmo\Timestampable(on="create")
     */
    protected $date;
    /**
     *
     * @ORM\Column(type="boolean")     
     */
    protected $state;
    
    /**
     *
     * @ORM\OneToMany(targetEntity="Refill", mappedBy="simOwner", cascade={"persist", "remove"})     * 
     */
    protected $reffils;
    

    function __construct(array $data = null)
    {
        $this->state = true;
    }

    /**
     * 
     * @return User
     */
    public function getUser()
    {
        return $this->user;
    }

    public function setUser(User $user)
    {
        $this->user = $user;
        return $this;
    }
    /**
     * 
     * @return Sim
     */
    public function getSim()
    {
        return $this->sim;
    }

    public function setSim(Sim $sim)
    {
        $this->sim = $sim;
        return $this;
    }


    public function getDate()
    {
        return $this->date;
    }

    public function setDate(\DateTime $date)
    {
        $this->date = $date;
    }

    public function getState()
    {
        return $this->state;
    }

    public function setState($state)
    {
        $this->state = $state;    
    }

}